home *** CD-ROM | disk | FTP | other *** search
- // --------------------------------------------------------------------------------------
- //
- // Test.
- // By Ben Manuto
- //
- // A Simple application to receive and send a short message via the Message system API.
- //
- // c.1996, by Apple Computer, Inc. All rights reserved.
- //
- // --------------------------------------------------------------------------------------
-
-
- typedef char SInt8;
- typedef short SInt16;
- typedef long SInt32;
- typedef unsigned char UInt8;
- typedef unsigned short UInt16;
- typedef unsigned long UInt32;
- typedef char __far* Ptr32;
-
-
- #define true 1
- #define false 0
-
- // ----------------------------------------------
-
- typedef struct MsgPBlk {
- struct MsgPBlk* link; // Link to next Queue element
- SInt16 msgCmd; // The message command or type
- SInt32 msgParam1; // Param 1
- SInt32 msgParam2; // Param 2
- UInt32 msgCompletion; // Ptr to the completion routine
- Ptr32 msgBuffer; // Ptr to the data buffer
- SInt32 msgReqCount; // Length of the data
- SInt32 msgActCount; // # of bytes actually transfered
- SInt8 msgResult; // The error code after complete or 1
- UInt8 msgFlags;
- UInt32 msgUserData; // for caller's use
- SInt32 msgVXD; // Used by VxD
- } MsgPBlk, *MsgPBlkPtr;
-
-
- typedef struct MsgRecElem {
- struct MsgRecElem* Link; // Ptr to next link
- SInt32 Code; // Ptr to the Code for this link
- SInt16 cmdBase; // the base message number for this proc
- SInt16 cmdCount; // the # of message numbers for this proc
- UInt32 userData; // for caller's use
- UInt32 recVXD; // Used by VxD
- } MsgRecElem, *MsgRecElemPtr;
-
-
- typedef struct AckInfo {
- SInt32 bytesReceived; // Number of bytes received by the Mac.
- UInt8 ackReceived; // Was the ack received from the Mac.
- } AckInfo;
-
-
- // externs
-
- extern UInt16 MsgAvailable();
- extern UInt16 MsgRegister(SInt32 msgSel, SInt16 msgCount, SInt16 *msgCmmd);
- extern UInt16 MsgInstHandler(MsgRecElemPtr msgRecElem);
- extern UInt16 MsgRmvHandler(MsgRecElemPtr msgRecElem);
- extern UInt16 MsgSend(MsgPBlkPtr msgPBlk);
- extern UInt16 MsgReceive(MsgPBlkPtr msgPBlk);
- extern void MsgHandler();
-
-
-
-